home *** CD-ROM | disk | FTP | other *** search
/ Champak 43 / Vol 43.iso / games / runrun.swf / scripts / frame_10 / DoAction.as
Encoding:
Text File  |  2007-07-07  |  934 b   |  44 lines

  1. stop();
  2. lives = 25;
  3. score = 0;
  4. render = true;
  5. koniec = false;
  6. miasto.gotoAndStop("test");
  7. this.onEnterFrame = function()
  8. {
  9.    napis = "Level:  " + (_currentframe - 9) + " / 25" + "        Score:  " + score + "        Lives:  " + lives;
  10.    if(lives == 0 && render == true)
  11.    {
  12.       koniec = true;
  13.       render = false;
  14.       gotoAndStop(4);
  15.    }
  16.    if(render == true)
  17.    {
  18.       score = (_currentframe - 9) * 100 + lives;
  19.       jumper._x += 3;
  20.    }
  21.    if(jumper._x >= 600)
  22.    {
  23.       nextFrame();
  24.       jumper._x = 0;
  25.       background._x = random(1800) - 600;
  26.    }
  27.    i = 0;
  28.    while(i < 20)
  29.    {
  30.       var reff = eval("obstacle" + i);
  31.       reff.onEnterFrame = function()
  32.       {
  33.          if(this.hitTest(jumper))
  34.          {
  35.             jumper._alpha = 50;
  36.             jumper.stop();
  37.             jumper.jumperbody.play();
  38.             render = false;
  39.          }
  40.       };
  41.       i++;
  42.    }
  43. };
  44.